﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MF.BO.Objects;
using MF.BL.Core;

namespace MF.WCF.Core
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MFActivity" in code, svc and config file together.
    public class MFActivity : IMFActivity
    {
        public List<ActivityItem> GetAllActivity()
        {
            List<ActivityItem> toReturn = new List<ActivityItem>();

            try
            {
                toReturn = BusinessUtils.ActivityService.GetAllActivity();
            }
            catch (Exception Ex)
            {
                throw Ex;

            }

            return toReturn;
        }

        public ActivityItem GetActivityItemById(long ID)
        {
            ActivityItem toReturn = new ActivityItem();

            try
            {
                toReturn = BusinessUtils.ActivityService.GetActivityItemById(ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return toReturn;
        }

        public int Insert(ActivityItem toInsert)
        {
            int toReturn = 0;

            try
            {
                toReturn = BusinessUtils.ActivityService.Insert(toInsert);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return toReturn;
        }

        public int Update(ActivityItem toUpdate)
        {
            int toReturn = 0;

            try
            {
                toReturn = BusinessUtils.ActivityService.Update(toUpdate);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return toReturn;
        }

        public int Delete(int idToDelete)
        {
            int toReturn = 0;

            try
            {
                toReturn = BusinessUtils.ActivityService.Delete(idToDelete);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return toReturn;
        }
    }
}
